object fit css

48

img {
    width: 100%;
    height: 100%; 
    object-fit: contain;
}
body {
  margin: 0;
}
img {
  display: block;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

Comments

Submit
0 Comments